package com.zhu2chu.log4j2monitor.webpage;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.jfinal.core.Controller;

/**
 * 日志监控页
 * 
 */
public class LogMonitorController extends Controller {

    private static final Logger log = LogManager.getLogger(LogMonitorController.class);

    public void index() {
        render("logmonitor.html");
    }

    /**
     * 模拟日志输出好让页面显示
     */
    public void mockLog() {
        log.info("你好，眼熟一下。");
        log.warn("警告：勿近！");
        log.error("系统已阵亡");
        renderNull();
        throw new RuntimeException();
    }

}
